#!/usr/bin/python3
# -*- coding=utf-8 -*-

import string
import random

class RandomString:
    def __init__(self, length):
        self.__LEN = length
        self.__DATAS = string.digits + string.ascii_letters

    def get_id(self):
        key = ''
        for i in xrange(1, self.__LEN + 1):
            key += random.choice(self.__DATAS)

        return key

    def __str__(sefl):
        return 'RandomString({})'.format(self.__LEN)

def main():
    rs = RandomString(10)
    strs = set()

    while len(strs) < 100:
        strs.add(rs.get_id())

    print(strs, len(strs))

if __name__ == '__main__':
    main()
